<?php

namespace Common\Model;

class PaymentsModel extends XuecheModel {

    protected $pk = 'payment_id';
    protected $tableName = 'payments';
    protected $fields = array(
        'payment_id', 'money', 'cur_money', 'member_id', 'status', 'pay_name', 'pay_type', 't_payed', 'op_id', 'payment_bn',
        'account', 'bank', 'pay_account', 'currency', 'paycost', 'pay_app_id', 'pay_ver', 'ip', 't_begin', 't_confirm',
        'memo', 'return_url', 'disabled', 'trade_no','thirdparty_account','prepay_id'
    );

    /**
     * 清空数据缓存
     * 
     */
    public function ClearAllCache() {
        
    }

    //缓存设置
    protected $_useCacheType = 'file';
    protected $_catheTime = 0;

    public function Validate($data) {

        return true;
    }

    public function GetDataById($id = 0, $field = null) {
        return parent::GetDataById($id, $field);
    }

    public function SaveData($data, $pks = array()) {
        return parent::SaveData($data, $pks);
    }

    public function GetDataByWhere($where = '', $order = '', $start = 0, $rows = 30, $fields = '', $hasCount = TRUE, $bigData = FALSE) {
        return parent::GetDataByWhere($where, $order, $start, $rows, $fields, $hasCount, $bigData);
    }

    public function GetCount($where) {
        $where = " 1=1 " . $where;
        return $this->where($where)->count($this->pk);
    }


}
